load Brgo.v3.0anno.Atgoslim.BP.list

load(file.path("..","Annotation_copy","output","v3.0annotation","Brgo.v3.0anno.Atgoslim.BP.list.Rdata"))

load GO.ORA function

GOseq function for Brassica rapa (v3.0)

# GOseq
library(ShortRead);library(goseq);library(GO.db);library("annotate")
## Loading required package: BiocGenerics
## Loading required package: parallel
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
## 
##     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
##     clusterExport, clusterMap, parApply, parCapply, parLapply,
##     parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## The following object is masked from 'package:limma':
## 
##     plotMA
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, basename, cbind, colnames,
##     dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
##     order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
##     rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
##     union, unique, unsplit, which, which.max, which.min
## Loading required package: BiocParallel
## Loading required package: Biostrings
## Loading required package: S4Vectors
## Loading required package: stats4
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following object is masked from 'package:tidyr':
## 
##     expand
## The following object is masked from 'package:base':
## 
##     expand.grid
## Loading required package: IRanges
## 
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## The following object is masked from 'package:purrr':
## 
##     reduce
## Loading required package: XVector
## 
## Attaching package: 'XVector'
## The following object is masked from 'package:purrr':
## 
##     compact
## 
## Attaching package: 'Biostrings'
## The following object is masked from 'package:base':
## 
##     strsplit
## Loading required package: Rsamtools
## Loading required package: GenomeInfoDb
## Loading required package: GenomicRanges
## Loading required package: GenomicAlignments
## Loading required package: SummarizedExperiment
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## Loading required package: DelayedArray
## Loading required package: matrixStats
## 
## Attaching package: 'matrixStats'
## The following objects are masked from 'package:Biobase':
## 
##     anyMissing, rowMedians
## The following object is masked from 'package:dplyr':
## 
##     count
## 
## Attaching package: 'DelayedArray'
## The following objects are masked from 'package:matrixStats':
## 
##     colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges
## The following object is masked from 'package:purrr':
## 
##     simplify
## The following objects are masked from 'package:base':
## 
##     aperm, apply, rowsum
## 
## Attaching package: 'GenomicAlignments'
## The following object is masked from 'package:dplyr':
## 
##     last
## 
## Attaching package: 'ShortRead'
## The following object is masked from 'package:dplyr':
## 
##     id
## The following object is masked from 'package:purrr':
## 
##     compose
## The following object is masked from 'package:tibble':
## 
##     view
## Loading required package: BiasedUrn
## Loading required package: geneLenDataBase
## 
## Attaching package: 'geneLenDataBase'
## The following object is masked from 'package:S4Vectors':
## 
##     unfactor
## 
## Loading required package: AnnotationDbi
## 
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:dplyr':
## 
##     select
## Loading required package: XML
# for ggplot heatmap
## uncompress gz file
system(paste("gunzip -c ",file.path("..","Annotation_copy","input","v3.0annotation","Brapa_genome_v3.0_cds.gz")," > ",file.path("..","Annotation_copy","input","v3.0annotation","Brapa_genome_v3.0_cds.fa")))
## read cDNA fasta file 
Bra.v3.0_cdna<-readDNAStringSet(file.path("..","Annotation_copy","input","v3.0annotation","Brapa_genome_v3.0_cds.fa")) # copied from /Volumes/data_work/Data8/NGS_related/Brassica_rapa_Upendra/G3
Bra.v3.0_cdna
##   A DNAStringSet instance of length 46250
##         width seq                                           names               
##     [1]  1254 ATGCGACCACCGGGTGTTGTT...GAGTCTCTCTTGCTCGCTTAA BraA01g000010.3C
##     [2]  1668 ATGCCAGCAATGCATGCCGTT...AGATGGATCACAAAAGATTAA BraA01g000020.3C
##     [3]   957 ATGATGCTTCTCGTTCATACC...AACTTGGAGTTCCCTGAGTGA BraA01g000030.3C
##     [4]  1299 ATGAGTCGTCTTCTCCTTGCT...GGGTCACGAGATGAGCTATAA BraA01g000040.3C
##     [5]   774 ATGGATTCTGGGCTTCAGCAT...GGAAAGCAGTTCCTTTCGTGA BraA01g000050.3C
##     ...   ... ...
## [46246]   162 ATGCGTCCGTCCTCAGCTCCC...TCTTTGGTGGTCCGGTTCTAA BraAnng001840.3C
## [46247]  1455 ATGTCTAATCAAGGATCAGGA...ACAGGTTTGTTTAGGTGCTAA BraAnng001850.3C
## [46248]  1011 ATGGACAACGTAATTCTGAAA...TCAGGGAAGAAAAGCCCCTGA BraAnng006150.3C
## [46249]   870 ATGTTTCCAAGACGTACAAGG...AGCAGTTGTCCTTATAGTTAG BraAnng000040.3C
## [46250]  1338 ATGCCGCAACAATACTGGAAC...GGAGAGAACCTTATCTCCTGA BraAnng003440.3C
## remove fasta file
system(paste("rm ",file.path("..","Annotation_copy","input","v3.0annotation","Brapa_genome_v3.0_cds.fa"),sep=""))
# GOseq function
GOseq.Brgo.v3.0.Atgoslim.BP.list.ORA<-function(genelist,padjust=0.05,ontology="BP",custom.category.list=Brgo.v3.0anno.Atgoslim.BP.list,Br_cdna=Bra.v3.0_cdna) { # return GO enrichment table, padjus, padjust=0.05. 
  
  bias<-nchar(Br_cdna)
  names(bias)<-names(Br_cdna)
  TF<-(names(bias) %in% genelist)*1
  names(TF)<-names(bias)
  #print(TF)
  pwf<-nullp(TF,bias.data=bias)
  #print(pwf$DEgenes)
  GO.pval <- goseq(pwf,gene2cat=custom.category.list,use_genes_without_cat=TRUE) # format became different in new goseq version (021111). Does not work (042716)
  #GO.pval <- goseq(pwf,gene2cat=Brgo.DF3,use_genes_without_cat=TRUE) # format became different in new goseq version (021111)
  
  #head(GO.pval) 
  if(ontology=="BP") {
    GO.pval2<-subset(GO.pval,ontology=="BP")
  } else if(ontology=="CC") {
    GO.pval2<-subset(GO.pval,ontology=="CC")
  } else {
    GO.pval2<-subset(GO.pval,ontology=="MF")
  }
    
  GO.pval2$over_represented_padjust<-p.adjust(GO.pval2$over_represented_pvalue,method="BH")
  if(GO.pval2$over_represented_padjust[1]>padjust) return("no enriched GO")
  else {
    enriched.GO<-GO.pval2[GO.pval2$over_represented_padjust<padjust,] 
    print("enriched.GO is")
    print(enriched.GO)
    
    ## write Term and Definition 
    for(i in 1:dim(enriched.GO)[1]) {
      if(is.null(Term(GOTERM[enriched.GO[i,"category"]]))) {next} else {
      enriched.GO$Term[i]<-Term(GOTERM[[enriched.GO[i,"category"]]])
      enriched.GO$Definition[i]<-Definition(GOTERM[[enriched.GO[i,"category"]]])
      }
    }
    return(enriched.GO)
  }
}
#
head(Bra.v3.0_cdna)
##   A DNAStringSet instance of length 6
##     width seq                                               names               
## [1]  1254 ATGCGACCACCGGGTGTTGTTTC...CTGAGTCTCTCTTGCTCGCTTAA BraA01g000010.3C
## [2]  1668 ATGCCAGCAATGCATGCCGTTTT...GTAGATGGATCACAAAAGATTAA BraA01g000020.3C
## [3]   957 ATGATGCTTCTCGTTCATACCCG...GGAACTTGGAGTTCCCTGAGTGA BraA01g000030.3C
## [4]  1299 ATGAGTCGTCTTCTCCTTGCTCA...GTGGGTCACGAGATGAGCTATAA BraA01g000040.3C
## [5]   774 ATGGATTCTGGGCTTCAGCATCT...AAGGAAAGCAGTTCCTTTCGTGA BraA01g000050.3C
## [6]  3327 ATGGCGTCCACTCCTCCTCAAAA...GCGGTGGGTTTCAATTTCCTTGA BraA01g000060.3C
# length(bias) # 44239 > 45019 where the bias come from?
#  bias.data vector must have the same length as DEgenes vector!

ORA: two afternoon trt and expression pattern

twoafternoon.trtlive.DEGs.all.v3.0anno<-read_csv(file=file.path("..","output","twoafternoon.trtlive.DEGs.all.v3.0anno.csv"))
## Parsed with column specification:
## cols(
##   genes = col_character(),
##   logFC = col_double(),
##   logCPM = col_double(),
##   LR = col_double(),
##   PValue = col_double(),
##   FDR = col_double(),
##   AGI = col_character(),
##   At_symbol = col_character(),
##   At_short_description = col_character(),
##   perc_ID = col_double()
## )
  library(dplyr)
  #genelist.up<-base::get(paste("../output/",DEG.objs.v3.0annotation.unique[n],sep="")) %>% rownames_to_column() %>%  dplyr::filter(logFC>0) # does not work
    temp<-twoafternoon.trtlive.DEGs.all.v3.0anno
    genelist.up<-temp[temp[,"logFC"]>0&temp[,"FDR"]<0.05,"genes"];genelist.down<-temp[temp[,"logFC"]<0&temp[,"FDR"]<0.05,"genes"] 
    # check logFC value () 
    temp[temp[,3]>0&temp[,3]<0.05,"logFC"] # previous version (before Feb 7, 2020)
    temp[temp[,"logFC"]>0&temp[,"FDR"]<0.05,"logFC"] # revised version (after Feb 7, 2020)
   print(paste("number of up genes is ",dim(genelist.up)[1]))
## [1] "number of up genes is  459"
  # expression pattern of upregulated genes
   gene.of.interest.FDR.up <- twoafternoon.trtlive.DEGs.all.v3.0anno %>% filter(FDR< 0.05,logFC>0) %>%
     dplyr::select(genes,logFC,FDR) %>% arrange(FDR)
   print("logFC>0")
## [1] "logFC>0"
   p.up1<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.up[1,]);p.up1
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector
## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.up2<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.up[2,]);p.up2
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.up3<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.up[3,]);p.up3
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.up4<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.up[4,]);p.up4
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.up5<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.up[5,]);p.up5
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

  # expression pattern of diwbregulated genes
   gene.of.interest.FDR.down <- twoafternoon.trtlive.DEGs.all.v3.0anno %>% filter(FDR< 0.05,logFC<0) %>% dplyr::select(genes,logFC,FDR) %>% arrange(FDR)
   print("logFC<0")
## [1] "logFC<0"
   p.down1<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.down[1,]);p.down1
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.down2<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.down[2,]);p.down2
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.down3<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.down[3,]);p.down3
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.down4<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.down[4,]);p.down4
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p.down5<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR.down[5,]);p.down5
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

    #genelist.down<-read_csv(paste("../output/",file,sep=""))  %>%  dplyr::filter(logFC.genotypeR500<0)
   if(dim(genelist.up)[1]<3) {print("Number of up genes is smaller than three. Skip this."); GO.ORA.temp.up<-"no enriched GO";next} else {GO.ORA.temp.up<-GOseq.Brgo.v3.0.Atgoslim.BP.list.ORA(as_vector(genelist.up)) }
## Warning in pcls(G): initial point very close to some inequality constraints
## Using manually entered categories.
## Calculating the p-values...
## 'select()' returned 1:1 mapping between keys and columns

## [1] "enriched.GO is"
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 3164 GO:0071732            6.820561e-08                1.0000000          8
## 3114 GO:0071369            2.089131e-07                1.0000000          8
## 1195 GO:0010167            1.021437e-06                0.9999999          7
## 3094 GO:0071281            1.955280e-06                0.9999998          8
## 1530 GO:0016036            7.136493e-06                0.9999990         10
## 254  GO:0006096            2.202118e-05                0.9999970          9
## 1445 GO:0015706            8.135340e-05                0.9999948          5
##      numInCat                                      term ontology
## 3164       52         cellular response to nitric oxide       BP
## 3114       62    cellular response to ethylene stimulus       BP
## 1195       53                       response to nitrate       BP
## 3094       77             cellular response to iron ion       BP
## 1530      148 cellular response to phosphate starvation       BP
## 254       138                        glycolytic process       BP
## 1445       39                         nitrate transport       BP
##      over_represented_padjust
## 3164             0.0002584311
## 3114             0.0003957859
## 1195             0.0012900754
## 3094             0.0018521386
## 1530             0.0054080343
## 254              0.0139063745
## 1445             0.0440354306
      print(paste("number of down genes is ",dim(genelist.down)[1]))
## [1] "number of down genes is  1015"
   if(dim(genelist.down)[1]<3) {print("Number of up genes is smaller than three. Skip this."); GO.ORA.temp.down<-"no enriched GO"; next} else {GO.ORA.temp.down<-GOseq.Brgo.v3.0.Atgoslim.BP.list.ORA(as_vector(genelist.down)) }
## Warning in pcls(G): initial point very close to some inequality constraints
## Using manually entered categories.
## Calculating the p-values...
## 'select()' returned 1:1 mapping between keys and columns

## [1] "enriched.GO is"
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 1210 GO:0010200            4.504540e-16                1.0000000         35
## 2253 GO:0042742            5.385608e-14                1.0000000         56
## 638  GO:0006952            7.545274e-13                1.0000000         72
## 2750 GO:0050832            2.359748e-11                1.0000000         37
## 890  GO:0009611            5.566564e-11                1.0000000         36
## 3708 GO:2000022            2.000124e-10                1.0000000         16
## 899  GO:0009626            6.561878e-10                1.0000000         20
## 423  GO:0006468            2.148206e-09                1.0000000         81
## 853  GO:0009407            2.454257e-08                1.0000000         11
## 1166 GO:0010112            2.807664e-08                1.0000000          8
## 557  GO:0006749            1.255567e-07                1.0000000         12
## 894  GO:0009617            1.473423e-07                1.0000000         22
## 1174 GO:0010120            2.496944e-07                1.0000000          8
## 972  GO:0009751            4.766890e-07                0.9999999         25
## 900  GO:0009627            6.998144e-07                0.9999999         13
## 855  GO:0009409            1.752277e-06                0.9999993         37
## 1038 GO:0009871            3.976235e-06                0.9999999          5
## 1858 GO:0031348            5.987811e-06                0.9999992         10
## 1857 GO:0031347            8.866320e-06                0.9999986         11
## 646  GO:0006979            1.247452e-05                0.9999955         28
## 3442 GO:1900067            1.481476e-05                1.0000000          3
## 1183 GO:0010150            2.707898e-05                0.9999927         17
## 1107 GO:0010030            2.844214e-05                0.9999967          8
## 49   GO:0000272            3.213706e-05                0.9999970          7
## 2986 GO:0062034            3.975137e-05                0.9999991          4
## 2439 GO:0045332            4.455056e-05                0.9999967          6
## 185  GO:0002229            5.052194e-05                0.9999887         13
## 2859 GO:0051707            9.404250e-05                0.9999827         10
## 234  GO:0006032            9.606073e-05                0.9999914          6
## 1460 GO:0015749            1.074678e-04                0.9999934          5
## 478  GO:0006562            1.084541e-04                0.9999992          3
## 1291 GO:0010345            1.123459e-04                0.9999869          7
## 619  GO:0006887            1.685980e-04                0.9999666         10
## 921  GO:0009651            1.797603e-04                0.9999078         44
## 3251 GO:0080142            1.838731e-04                0.9999872          5
## 944  GO:0009697            1.865949e-04                0.9999867          5
## 859  GO:0009414            2.028253e-04                0.9999119         29
## 1001 GO:0009816            2.098586e-04                0.9999573         10
## 2617 GO:0048194            2.349755e-04                0.9999825          5
## 1177 GO:0010133            2.697046e-04                0.9999958          3
## 1030 GO:0009862            2.758968e-04                0.9999781          5
## 2247 GO:0042593            3.361831e-04                0.9999921          3
## 1002 GO:0009817            3.842136e-04                0.9999234          9
## 187  GO:0002237            4.003418e-04                0.9999202          9
## 2223 GO:0042344            4.121584e-04                0.9999773          4
## 1859 GO:0031349            4.498132e-04                0.9999756          4
## 2794 GO:0051258            5.343753e-04                0.9999875          3
## 2917 GO:0055114            5.773902e-04                0.9996410         71
##      numInCat
## 1210      286
## 2253      726
## 638      1165
## 2750      469
## 890       419
## 3708       89
## 899       140
## 423      1484
## 853        67
## 1166       22
## 557        85
## 894       241
## 1174       27
## 972       347
## 900       104
## 855       696
## 1038       11
## 1858       64
## 1857       95
## 646       502
## 3442        3
## 1183      219
## 1107       54
## 49         39
## 2986        8
## 2439       23
## 185       126
## 2859       97
## 234        35
## 1460       18
## 478         4
## 1291       41
## 619        96
## 921      1045
## 3251       19
## 944        21
## 859       596
## 1001       97
## 2617       20
## 1177        5
## 1030       24
## 2247        8
## 1002      100
## 187        88
## 2223       15
## 1859       13
## 2794        6
## 2917     1923
##                                                                                               term
## 1210                                                                            response to chitin
## 2253                                                                 defense response to bacterium
## 638                                                                               defense response
## 2750                                                                    defense response to fungus
## 890                                                                           response to wounding
## 3708                                        regulation of jasmonic acid mediated signaling pathway
## 899                                                             plant-type hypersensitive response
## 423                                                                        protein phosphorylation
## 853                                                                        toxin catabolic process
## 1166                                                    regulation of systemic acquired resistance
## 557                                                                  glutathione metabolic process
## 894                                                                          response to bacterium
## 1174                                                                camalexin biosynthetic process
## 972                                                                     response to salicylic acid
## 900                                                                   systemic acquired resistance
## 855                                                                               response to cold
## 1038 jasmonic acid and ethylene-dependent systemic resistance, ethylene mediated signaling pathway
## 1858                                                       negative regulation of defense response
## 1857                                                                regulation of defense response
## 646                                                                   response to oxidative stress
## 3442                                                regulation of cellular response to alkaline pH
## 1183                                                                               leaf senescence
## 1107                                                       positive regulation of seed germination
## 49                                                                polysaccharide catabolic process
## 2986                                                         L-pipecolic acid biosynthetic process
## 2439                                                                    phospholipid translocation
## 185                                                                  defense response to oomycetes
## 2859                                                                    response to other organism
## 234                                                                       chitin catabolic process
## 1460                                                        monosaccharide transmembrane transport
## 478                                                                      proline catabolic process
## 1291                                                                  suberin biosynthetic process
## 619                                                                                     exocytosis
## 921                                                                        response to salt stress
## 3251                                             regulation of salicylic acid biosynthetic process
## 944                                                            salicylic acid biosynthetic process
## 859                                                                  response to water deprivation
## 1001                                       defense response to bacterium, incompatible interaction
## 2617                                                                         Golgi vesicle budding
## 1177                                                        proline catabolic process to glutamate
## 1030                       systemic acquired resistance, salicylic acid mediated signaling pathway
## 2247                                                                           glucose homeostasis
## 1002                                          defense response to fungus, incompatible interaction
## 187                                                       response to molecule of bacterial origin
## 2223                                                        indole glucosinolate catabolic process
## 1859                                                       positive regulation of defense response
## 2794                                                                        protein polymerization
## 2917                                                                   oxidation-reduction process
##      ontology over_represented_padjust
## 1210       BP             1.706770e-12
## 2253       BP             1.020303e-10
## 638        BP             9.529681e-10
## 2750       BP             2.235271e-08
## 890        BP             4.218342e-08
## 3708       BP             1.263079e-07
## 899        BP             3.551851e-07
## 423        BP             1.017444e-06
## 853        BP             1.033242e-05
## 1166       BP             1.063824e-05
## 557        BP             4.324859e-05
## 894        BP             4.652334e-05
## 1174       BP             7.277632e-05
## 972        BP             1.290125e-04
## 900        BP             1.767731e-04
## 855        BP             4.149611e-04
## 1038       BP             8.862326e-04
## 1858       BP             1.260434e-03
## 1857       BP             1.768131e-03
## 646        BP             2.363297e-03
## 3442       BP             2.673007e-03
## 1183       BP             4.663739e-03
## 1107       BP             4.685533e-03
## 49         BP             5.073638e-03
## 2986       BP             6.024717e-03
## 2439       BP             6.492387e-03
## 185        BP             7.089912e-03
## 2859       BP             1.255083e-02
## 234        BP             1.255083e-02
## 1460       BP             1.325589e-02
## 478        BP             1.325589e-02
## 1291       BP             1.330246e-02
## 619        BP             1.935812e-02
## 921        BP             1.963911e-02
## 3251       BP             1.963911e-02
## 944        BP             1.963911e-02
## 859        BP             2.077041e-02
## 1001       BP             2.092512e-02
## 2617       BP             2.282878e-02
## 1177       BP             2.549690e-02
## 1030       BP             2.549690e-02
## 2247       BP             3.032851e-02
## 1002       BP             3.385547e-02
## 187        BP             3.447489e-02
## 2223       BP             3.470374e-02
## 1859       BP             3.705092e-02
## 2794       BP             4.307975e-02
## 2917       BP             4.557774e-02
    # handling "no enriched GO" 
    # genelist.names<-c("GO.ORA.temp.up_down","GO.ORA.temp.down_up") # test
    x<-list(GO.ORA.up=GO.ORA.temp.up,
            GO.ORA.down=GO.ORA.temp.down) # list
    # x<-x[!x=="no enriched GO"] # remove "no enriched GO" result
    ## add sample info and FC info and save GO.ORA result
        if(length(x)==0) {next} else {GO.ORA.result<-x}
GO.ORA.result 
## $GO.ORA.up
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 3164 GO:0071732            6.820561e-08                1.0000000          8
## 3114 GO:0071369            2.089131e-07                1.0000000          8
## 1195 GO:0010167            1.021437e-06                0.9999999          7
## 3094 GO:0071281            1.955280e-06                0.9999998          8
## 1530 GO:0016036            7.136493e-06                0.9999990         10
## 254  GO:0006096            2.202118e-05                0.9999970          9
## 1445 GO:0015706            8.135340e-05                0.9999948          5
##      numInCat                                      term ontology
## 3164       52         cellular response to nitric oxide       BP
## 3114       62    cellular response to ethylene stimulus       BP
## 1195       53                       response to nitrate       BP
## 3094       77             cellular response to iron ion       BP
## 1530      148 cellular response to phosphate starvation       BP
## 254       138                        glycolytic process       BP
## 1445       39                         nitrate transport       BP
##      over_represented_padjust                                      Term
## 3164             0.0002584311         cellular response to nitric oxide
## 3114             0.0003957859    cellular response to ethylene stimulus
## 1195             0.0012900754                       response to nitrate
## 3094             0.0018521386             cellular response to iron ion
## 1530             0.0054080343 cellular response to phosphate starvation
## 254              0.0139063745                        glycolytic process
## 1445             0.0440354306                         nitrate transport
##                                                                                                                                                                                                                                                                                                                                                                                                                                          Definition
## 3164                                                                                                                                                                                                                                                        Any process that results in a change in state or activity of a cell (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a nitric oxide stimulus.
## 3114                                                                                                                                                                                                                                                  Any process that results in a change in state or activity of a cell (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of an ethylene (ethene) stimulus.
## 1195                                                                                                                                                                                                                                              Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a nitrate stimulus.
## 3094                                                                                                                                                                                                                                                           Any process that results in a change in state or activity of a cell (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of an iron ion stimulus.
## 1530                                                                                                                                                                                                                                                       Any process that results in a change in state or activity of a cell (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of deprivation of phosphate.
## 254  The chemical reactions and pathways resulting in the breakdown of a carbohydrate into pyruvate, with the concomitant production of a small amount of ATP and the reduction of NAD(P) to NAD(P)H. Glycolysis begins with the metabolism of a carbohydrate to generate products that can enter the pathway and ends with the production of pyruvate. Pyruvate may be converted to acetyl-coenzyme A, ethanol, lactate, or other small molecules.
## 1445                                                                                                                                                                                                                                                                                                        The directed movement of nitrate into, out of or within a cell, or between cells, by means of some agent such as a transporter or pore.
## 
## $GO.ORA.down
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 1210 GO:0010200            4.504540e-16                1.0000000         35
## 2253 GO:0042742            5.385608e-14                1.0000000         56
## 638  GO:0006952            7.545274e-13                1.0000000         72
## 2750 GO:0050832            2.359748e-11                1.0000000         37
## 890  GO:0009611            5.566564e-11                1.0000000         36
## 3708 GO:2000022            2.000124e-10                1.0000000         16
## 899  GO:0009626            6.561878e-10                1.0000000         20
## 423  GO:0006468            2.148206e-09                1.0000000         81
## 853  GO:0009407            2.454257e-08                1.0000000         11
## 1166 GO:0010112            2.807664e-08                1.0000000          8
## 557  GO:0006749            1.255567e-07                1.0000000         12
## 894  GO:0009617            1.473423e-07                1.0000000         22
## 1174 GO:0010120            2.496944e-07                1.0000000          8
## 972  GO:0009751            4.766890e-07                0.9999999         25
## 900  GO:0009627            6.998144e-07                0.9999999         13
## 855  GO:0009409            1.752277e-06                0.9999993         37
## 1038 GO:0009871            3.976235e-06                0.9999999          5
## 1858 GO:0031348            5.987811e-06                0.9999992         10
## 1857 GO:0031347            8.866320e-06                0.9999986         11
## 646  GO:0006979            1.247452e-05                0.9999955         28
## 3442 GO:1900067            1.481476e-05                1.0000000          3
## 1183 GO:0010150            2.707898e-05                0.9999927         17
## 1107 GO:0010030            2.844214e-05                0.9999967          8
## 49   GO:0000272            3.213706e-05                0.9999970          7
## 2986 GO:0062034            3.975137e-05                0.9999991          4
## 2439 GO:0045332            4.455056e-05                0.9999967          6
## 185  GO:0002229            5.052194e-05                0.9999887         13
## 2859 GO:0051707            9.404250e-05                0.9999827         10
## 234  GO:0006032            9.606073e-05                0.9999914          6
## 1460 GO:0015749            1.074678e-04                0.9999934          5
## 478  GO:0006562            1.084541e-04                0.9999992          3
## 1291 GO:0010345            1.123459e-04                0.9999869          7
## 619  GO:0006887            1.685980e-04                0.9999666         10
## 921  GO:0009651            1.797603e-04                0.9999078         44
## 3251 GO:0080142            1.838731e-04                0.9999872          5
## 944  GO:0009697            1.865949e-04                0.9999867          5
## 859  GO:0009414            2.028253e-04                0.9999119         29
## 1001 GO:0009816            2.098586e-04                0.9999573         10
## 2617 GO:0048194            2.349755e-04                0.9999825          5
## 1177 GO:0010133            2.697046e-04                0.9999958          3
## 1030 GO:0009862            2.758968e-04                0.9999781          5
## 2247 GO:0042593            3.361831e-04                0.9999921          3
## 1002 GO:0009817            3.842136e-04                0.9999234          9
## 187  GO:0002237            4.003418e-04                0.9999202          9
## 2223 GO:0042344            4.121584e-04                0.9999773          4
## 1859 GO:0031349            4.498132e-04                0.9999756          4
## 2794 GO:0051258            5.343753e-04                0.9999875          3
## 2917 GO:0055114            5.773902e-04                0.9996410         71
##      numInCat
## 1210      286
## 2253      726
## 638      1165
## 2750      469
## 890       419
## 3708       89
## 899       140
## 423      1484
## 853        67
## 1166       22
## 557        85
## 894       241
## 1174       27
## 972       347
## 900       104
## 855       696
## 1038       11
## 1858       64
## 1857       95
## 646       502
## 3442        3
## 1183      219
## 1107       54
## 49         39
## 2986        8
## 2439       23
## 185       126
## 2859       97
## 234        35
## 1460       18
## 478         4
## 1291       41
## 619        96
## 921      1045
## 3251       19
## 944        21
## 859       596
## 1001       97
## 2617       20
## 1177        5
## 1030       24
## 2247        8
## 1002      100
## 187        88
## 2223       15
## 1859       13
## 2794        6
## 2917     1923
##                                                                                               term
## 1210                                                                            response to chitin
## 2253                                                                 defense response to bacterium
## 638                                                                               defense response
## 2750                                                                    defense response to fungus
## 890                                                                           response to wounding
## 3708                                        regulation of jasmonic acid mediated signaling pathway
## 899                                                             plant-type hypersensitive response
## 423                                                                        protein phosphorylation
## 853                                                                        toxin catabolic process
## 1166                                                    regulation of systemic acquired resistance
## 557                                                                  glutathione metabolic process
## 894                                                                          response to bacterium
## 1174                                                                camalexin biosynthetic process
## 972                                                                     response to salicylic acid
## 900                                                                   systemic acquired resistance
## 855                                                                               response to cold
## 1038 jasmonic acid and ethylene-dependent systemic resistance, ethylene mediated signaling pathway
## 1858                                                       negative regulation of defense response
## 1857                                                                regulation of defense response
## 646                                                                   response to oxidative stress
## 3442                                                regulation of cellular response to alkaline pH
## 1183                                                                               leaf senescence
## 1107                                                       positive regulation of seed germination
## 49                                                                polysaccharide catabolic process
## 2986                                                         L-pipecolic acid biosynthetic process
## 2439                                                                    phospholipid translocation
## 185                                                                  defense response to oomycetes
## 2859                                                                    response to other organism
## 234                                                                       chitin catabolic process
## 1460                                                        monosaccharide transmembrane transport
## 478                                                                      proline catabolic process
## 1291                                                                  suberin biosynthetic process
## 619                                                                                     exocytosis
## 921                                                                        response to salt stress
## 3251                                             regulation of salicylic acid biosynthetic process
## 944                                                            salicylic acid biosynthetic process
## 859                                                                  response to water deprivation
## 1001                                       defense response to bacterium, incompatible interaction
## 2617                                                                         Golgi vesicle budding
## 1177                                                        proline catabolic process to glutamate
## 1030                       systemic acquired resistance, salicylic acid mediated signaling pathway
## 2247                                                                           glucose homeostasis
## 1002                                          defense response to fungus, incompatible interaction
## 187                                                       response to molecule of bacterial origin
## 2223                                                        indole glucosinolate catabolic process
## 1859                                                       positive regulation of defense response
## 2794                                                                        protein polymerization
## 2917                                                                   oxidation-reduction process
##      ontology over_represented_padjust
## 1210       BP             1.706770e-12
## 2253       BP             1.020303e-10
## 638        BP             9.529681e-10
## 2750       BP             2.235271e-08
## 890        BP             4.218342e-08
## 3708       BP             1.263079e-07
## 899        BP             3.551851e-07
## 423        BP             1.017444e-06
## 853        BP             1.033242e-05
## 1166       BP             1.063824e-05
## 557        BP             4.324859e-05
## 894        BP             4.652334e-05
## 1174       BP             7.277632e-05
## 972        BP             1.290125e-04
## 900        BP             1.767731e-04
## 855        BP             4.149611e-04
## 1038       BP             8.862326e-04
## 1858       BP             1.260434e-03
## 1857       BP             1.768131e-03
## 646        BP             2.363297e-03
## 3442       BP             2.673007e-03
## 1183       BP             4.663739e-03
## 1107       BP             4.685533e-03
## 49         BP             5.073638e-03
## 2986       BP             6.024717e-03
## 2439       BP             6.492387e-03
## 185        BP             7.089912e-03
## 2859       BP             1.255083e-02
## 234        BP             1.255083e-02
## 1460       BP             1.325589e-02
## 478        BP             1.325589e-02
## 1291       BP             1.330246e-02
## 619        BP             1.935812e-02
## 921        BP             1.963911e-02
## 3251       BP             1.963911e-02
## 944        BP             1.963911e-02
## 859        BP             2.077041e-02
## 1001       BP             2.092512e-02
## 2617       BP             2.282878e-02
## 1177       BP             2.549690e-02
## 1030       BP             2.549690e-02
## 2247       BP             3.032851e-02
## 1002       BP             3.385547e-02
## 187        BP             3.447489e-02
## 2223       BP             3.470374e-02
## 1859       BP             3.705092e-02
## 2794       BP             4.307975e-02
## 2917       BP             4.557774e-02
##                                                                                               Term
## 1210                                                                            response to chitin
## 2253                                                                 defense response to bacterium
## 638                                                                               defense response
## 2750                                                                    defense response to fungus
## 890                                                                           response to wounding
## 3708                                        regulation of jasmonic acid mediated signaling pathway
## 899                                                             plant-type hypersensitive response
## 423                                                                        protein phosphorylation
## 853                                                                        toxin catabolic process
## 1166                                                    regulation of systemic acquired resistance
## 557                                                                  glutathione metabolic process
## 894                                                                          response to bacterium
## 1174                                                                camalexin biosynthetic process
## 972                                                                     response to salicylic acid
## 900                                                                   systemic acquired resistance
## 855                                                                               response to cold
## 1038 jasmonic acid and ethylene-dependent systemic resistance, ethylene mediated signaling pathway
## 1858                                                       negative regulation of defense response
## 1857                                                                regulation of defense response
## 646                                                                   response to oxidative stress
## 3442                                                regulation of cellular response to alkaline pH
## 1183                                                                               leaf senescence
## 1107                                                       positive regulation of seed germination
## 49                                                                polysaccharide catabolic process
## 2986                                                         L-pipecolic acid biosynthetic process
## 2439                                                                    phospholipid translocation
## 185                                                                  defense response to oomycetes
## 2859                                                                    response to other organism
## 234                                                                       chitin catabolic process
## 1460                                                        monosaccharide transmembrane transport
## 478                                                                      proline catabolic process
## 1291                                                                  suberin biosynthetic process
## 619                                                                                     exocytosis
## 921                                                                        response to salt stress
## 3251                                             regulation of salicylic acid biosynthetic process
## 944                                                            salicylic acid biosynthetic process
## 859                                                                  response to water deprivation
## 1001                                       defense response to bacterium, incompatible interaction
## 2617                                                                         Golgi vesicle budding
## 1177                                                        proline catabolic process to glutamate
## 1030                       systemic acquired resistance, salicylic acid mediated signaling pathway
## 2247                                                                           glucose homeostasis
## 1002                                          defense response to fungus, incompatible interaction
## 187                                                       response to molecule of bacterial origin
## 2223                                                        indole glucosinolate catabolic process
## 1859                                                       positive regulation of defense response
## 2794                                                                        protein polymerization
## 2917                                                                   oxidation-reduction process
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Definition
## 1210                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         A process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a chitin stimulus.
## 2253                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Reactions triggered in response to the presence of a bacterium that act to protect the cell or organism.
## 638                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Reactions, triggered in response to the presence of a foreign body or the occurrence of an injury, which result in restriction of damage to the organism attacked or prevention/recovery from the infection caused by the attack.
## 2750                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Reactions triggered in response to the presence of a fungus that act to protect the cell or organism.
## 890                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a stimulus indicating damage to the organism.
## 3708                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Any process that modulates the frequency, rate or extent of jasmonic acid mediated signaling pathway.
## 899                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The rapid, localized death of plant cells in response to invasion by a pathogen.
## 423                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           The process of introducing a phosphate group on to a protein.
## 853                                                                                                                                                                                                                                                                                                                                                                                                                                                          The chemical reactions and pathways resulting in the breakdown of toxin, a poisonous compound (typically a protein) that is produced by cells or organisms and that can cause disease when introduced into the body or tissues of an organism.
## 1166                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Any process that modulates the frequency, rate or extent of systemic acquired resistance.
## 557                                                                                                                                                                                                                                                                                                                  The chemical reactions and pathways involving glutathione, the tripeptide glutamylcysteinylglycine, which acts as a coenzyme for some enzymes and as an antioxidant in the protection of sulfhydryl groups in enzymes and other proteins; it has a specific role in the reduction of hydrogen peroxide (H2O2) and oxidized ascorbate, and it participates in the gamma-glutamyl cycle.
## 894                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a stimulus from a bacterium.
## 1174                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    The chemical reactions and pathways resulting in the formation of camalexin, an indole phytoalexin.
## 972                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a salicylic acid stimulus.
## 900                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             The salicylic acid mediated response to a pathogen which confers broad spectrum resistance.
## 855                                                                                                                                                                                                                                                                                                                                                                                                                                  Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a cold stimulus, a temperature stimulus below the optimal temperature for that organism.
## 1038                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The series of molecular signals mediated by ethylene (ethene) involved in jasmonic acid/ethylene dependent systemic resistance.
## 1858                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Any process that stops, prevents, or reduces the frequency, rate or extent of a defense response.
## 1857                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Any process that modulates the frequency, rate or extent of a defense response.
## 646                                                                                                                                                                                                                                                                                                                                               Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of oxidative stress, a state often resulting from exposure to high levels of reactive oxygen species, e.g. superoxide anions, hydrogen peroxide (H2O2), and hydroxyl radicals.
## 3442                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <NA>
## 1183                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     The process that occurs in a leaf near the end of its active life that is associated with the dismantling of cell components and membranes, loss of functional chloroplasts, and an overall decline in metabolism.
## 1107                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Any process that activates or increase the rate of seed germination.
## 49                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The chemical reactions and pathways resulting in the breakdown of a polysaccharide, a polymer of many (typically more than 10) monosaccharide residues linked glycosidically.
## 2986                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The chemical reactions and pathways resulting in the formation of L-pipecolic acid, a metabolite of lysine.
## 2439                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The movement of a phospholipid molecule from one leaflet of a membrane bilayer to the opposite leaflet.
## 185                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Reactions triggered in response to the presence of oomycetes that act to protect the cell or organism.
## 2859                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a stimulus from another living organism.
## 234                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     The chemical reactions and pathways resulting in the breakdown of chitin, a linear polysaccharide consisting of beta-(1->4)-linked N-acetyl-D-glucosamine residues.
## 1460                                                                                                                                                                                                                                                                                                                           The process in which a monosaccharide is transported across a lipid bilayer, from one side of a membrane to the other. Monosaccharides are the simplest carbohydrates; they are polyhydric alcohols containing either an aldehyde or a keto group and between three to ten or more carbon atoms. They form the constitutional repeating units of oligo- and polysaccharides.
## 478                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The chemical reactions and pathways resulting in the breakdown of proline (pyrrolidine-2-carboxylic acid), a chiral, cyclic, nonessential alpha-amino acid found in peptide linkage in proteins.
## 1291                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The chemical reactions and pathways resulting in the formation of suberin monomers and suberin polyesters. Suberin monomers are derived from fatty acids and trans-cinnamic acids. The monomers are then cross-linked with glycerols.
## 619  A process of secretion by a cell that results in the release of intracellular molecules (e.g. hormones, matrix proteins) contained within a membrane-bounded vesicle. Exocytosis can occur either by full fusion, when the vesicle collapses into the plasma membrane, or by a kiss-and-run mechanism that involves the formation of a transient contact, a pore, between a granule (for exemple of chromaffin cells) and the plasma membrane. The latter process most of the time leads to only partial secretion of the granule content. Exocytosis begins with steps that prepare vesicles for fusion with the membrane (tethering and docking) and ends when molecules are secreted from the cell.
## 921                                                                                                                                                                                                                                                                                                                                                                Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a stimulus indicating an increase or decrease in the concentration of salt (particularly but not exclusively sodium and chloride ions) in the environment.
## 3251                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Any process that modulates the frequency, rate or extent of the chemical reactions and pathways resulting in the formation of salicylic acid.
## 944                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 The chemical reactions and pathways resulting in the formation of salicylic acid (2-hydroxybenzoic acid), a derivative of benzoic acid.
## 859                                                                                                                                                                                                                                                                                                                                                                                                                                                             Any process that results in a change in state or activity of a cell or an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a water deprivation stimulus, prolonged deprivation of water.
## 1001                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            A response of an organism to a bacterium that prevents the occurrence or spread of disease.
## 2617                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The evagination of the Golgi membrane, resulting in formation of a vesicle.
## 1177                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   The chemical reactions and pathways resulting in the breakdown of proline into other compounds, including glutamate.
## 1030                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   The series of molecular signals mediated by salicylic acid involved in systemic acquired resistance.
## 2247                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Any process involved in the maintenance of an internal steady state of glucose within an organism or cell.
## 1002                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               A response of an organism to a fungus that prevents the occurrence or spread of disease.
## 187                                                                                                                                                                                                                                                                                                                                                                                                                                      Any process that results in a change in state or activity of an organism (in terms of movement, secretion, enzyme production, gene expression, etc.) as a result of a stimulus by molecules of bacterial origin such as peptides derived from bacterial flagellin.
## 2223                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The chemical reactions and pathways resulting in the breakdown of indole glucosinolates, sulfur-containing compounds that have a common structure linked to an R group derived from tryptophan.
## 1859                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Any process that activates or increases the frequency, rate or extent of a defense response.
## 2794                                                                                                                                                                                                                                                                                                                                                                                                                        The process of creating protein polymers, compounds composed of a large number of component monomers; polymeric proteins may be made up of different or identical monomers. Polymerization occurs by the addition of extra monomers to an existing poly- or oligomeric protein.
## 2917                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               A metabolic process that results in the removal or addition of one or more electrons to or from a substance, with or without the concomitant removal or addition of a proton or protons.
# GO.ORA.result %>% bind_rows() %>% View()
GO.ORA.result.DF <- GO.ORA.result%>% enframe() %>% unnest(value) # %>% View()
# save data           
# save(GO.ORA.result,file="../output/GOseq.timecourse.twoafternoon.Brgo.v3.0.Atgoslim.BP.list.enrich.Rdata")
write_csv(GO.ORA.result.DF, path=file.path("..","output","twoafternoon.trtlive.DEGs.GO.ORA.v3.0anno.csv"))

ORA: two afternoon interaction only and expression pattern

twoafternoon.interaction.trtlive.samplingday.lrt.DEGs.all.v3.0anno<-read_csv(file=file.path("..","output","twoafternoon.interaction.trtlive.samplingday.lrt.DEGs.all.v3.0anno.csv"))
## Parsed with column specification:
## cols(
##   genes = col_character(),
##   logFC.soil_trtSBC_OLD.sampling_day03 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day04 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day06 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day08 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day10 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day13 = col_double(),
##   logFC.soil_trtSBC_OLD.sampling_day14 = col_double(),
##   logCPM = col_double(),
##   LR = col_double(),
##   PValue = col_double(),
##   FDR = col_double(),
##   AGI = col_character(),
##   At_symbol = col_character(),
##   At_short_description = col_character(),
##   perc_ID = col_double()
## )
  library(dplyr)
  #genelist.up<-base::get(paste("../output/",DEG.objs.v3.0annotation.unique[n],sep="")) %>% rownames_to_column() %>%  dplyr::filter(logFC>0) # does not work
    temp<-twoafternoon.trtlive.DEGs.all.v3.0anno
    genelist<-temp[temp[,"FDR"]<0.05,"genes"]
   print(paste("number of up genes is ",dim(genelist)[1]))
## [1] "number of up genes is  1474"
  # expression pattern 
   gene.of.interest.FDR <- twoafternoon.interaction.trtlive.samplingday.lrt.DEGs.all.v3.0anno %>% filter(FDR< 0.05) %>%
     dplyr::select(genes,FDR) %>% arrange(FDR)
   p1<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[1,]);p1
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector
## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p2<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[2,]);p2
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p3<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[3,]);p3
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p4<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[4,]);p4
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p5<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[5,]);p5
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

    #genelist.down<-read_csv(paste("../output/",file,sep=""))  %>%  dplyr::filter(logFC.genotypeR500<0)
   if(dim(genelist)[1]<3) {print("Number of up genes is smaller than three. Skip this."); GO.ORA.temp<-"no enriched GO";next} else {GO.ORA.temp<-GOseq.Brgo.v3.0.Atgoslim.BP.list.ORA(as_vector(genelist)) }
## Warning in pcls(G): initial point very close to some inequality constraints
## Using manually entered categories.
## Calculating the p-values...
## 'select()' returned 1:1 mapping between keys and columns

## [1] "enriched.GO is"
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 1210 GO:0010200            4.095158e-12                1.0000000         36
## 2253 GO:0042742            1.579177e-10                1.0000000         62
## 890  GO:0009611            2.727471e-09                1.0000000         41
## 638  GO:0006952            9.236316e-09                1.0000000         80
## 3708 GO:2000022            3.808132e-08                1.0000000         16
## 899  GO:0009626            5.899027e-08                1.0000000         21
## 2750 GO:0050832            6.644975e-08                1.0000000         39
## 1166 GO:0010112            4.664472e-07                1.0000000          8
## 853  GO:0009407            1.147806e-06                0.9999999         11
## 900  GO:0009627            1.596539e-06                0.9999997         15
## 646  GO:0006979            1.708851e-06                0.9999993         38
## 1174 GO:0010120            3.844295e-06                0.9999997          8
## 423  GO:0006468            3.882556e-06                0.9999980         94
## 894  GO:0009617            5.522889e-06                0.9999983         24
## 557  GO:0006749            6.475601e-06                0.9999989         12
## 855  GO:0009409            1.353825e-05                0.9999938         45
## 898  GO:0009625            1.847506e-05                0.9999966         12
## 1038 GO:0009871            2.347250e-05                0.9999991          5
## 2859 GO:0051707            2.416467e-05                0.9999951         13
## 2439 GO:0045332            3.325811e-05                0.9999971          7
## 972  GO:0009751            3.674037e-05                0.9999862         27
## 3442 GO:1900067            4.456149e-05                1.0000000          3
## 1857 GO:0031347            5.629769e-05                0.9999883         12
## 1107 GO:0010030            6.202572e-05                0.9999907          9
## 3164 GO:0071732            7.229820e-05                0.9999890          9
## 1183 GO:0010150            9.353298e-05                0.9999690         20
## 2617 GO:0048194            1.285276e-04                0.9999889          6
## 1858 GO:0031348            1.301439e-04                0.9999757         10
## 2986 GO:0062034            1.614913e-04                0.9999947          4
## 3114 GO:0071369            1.777013e-04                0.9999690          9
## 2917 GO:0055114            1.842612e-04                0.9998808         99
## 607  GO:0006869            2.458597e-04                0.9999269         15
## 478  GO:0006562            3.131506e-04                0.9999965          3
## 49   GO:0000272            3.172743e-04                0.9999562          7
## 1002 GO:0009817            3.721528e-04                0.9999113         11
##      numInCat
## 1210      286
## 2253      726
## 890       419
## 638      1165
## 3708       89
## 899       140
## 2750      469
## 1166       22
## 853        67
## 900       104
## 646       502
## 1174       27
## 423      1484
## 894       241
## 557        85
## 855       696
## 898        84
## 1038       11
## 2859       97
## 2439       23
## 972       347
## 3442        3
## 1857       95
## 1107       54
## 3164       52
## 1183      219
## 2617       20
## 1858       64
## 2986        8
## 3114       62
## 2917     1923
## 607       208
## 478         4
## 49         39
## 1002      100
##                                                                                               term
## 1210                                                                            response to chitin
## 2253                                                                 defense response to bacterium
## 890                                                                           response to wounding
## 638                                                                               defense response
## 3708                                        regulation of jasmonic acid mediated signaling pathway
## 899                                                             plant-type hypersensitive response
## 2750                                                                    defense response to fungus
## 1166                                                    regulation of systemic acquired resistance
## 853                                                                        toxin catabolic process
## 900                                                                   systemic acquired resistance
## 646                                                                   response to oxidative stress
## 1174                                                                camalexin biosynthetic process
## 423                                                                        protein phosphorylation
## 894                                                                          response to bacterium
## 557                                                                  glutathione metabolic process
## 855                                                                               response to cold
## 898                                                                             response to insect
## 1038 jasmonic acid and ethylene-dependent systemic resistance, ethylene mediated signaling pathway
## 2859                                                                    response to other organism
## 2439                                                                    phospholipid translocation
## 972                                                                     response to salicylic acid
## 3442                                                regulation of cellular response to alkaline pH
## 1857                                                                regulation of defense response
## 1107                                                       positive regulation of seed germination
## 3164                                                             cellular response to nitric oxide
## 1183                                                                               leaf senescence
## 2617                                                                         Golgi vesicle budding
## 1858                                                       negative regulation of defense response
## 2986                                                         L-pipecolic acid biosynthetic process
## 3114                                                        cellular response to ethylene stimulus
## 2917                                                                   oxidation-reduction process
## 607                                                                                lipid transport
## 478                                                                      proline catabolic process
## 49                                                                polysaccharide catabolic process
## 1002                                          defense response to fungus, incompatible interaction
##      ontology over_represented_padjust
## 1210       BP             1.551655e-08
## 2253       BP             2.991750e-07
## 890        BP             3.444795e-06
## 638        BP             8.749100e-06
## 3708       BP             2.885803e-05
## 899        BP             3.596830e-05
## 2750       BP             3.596830e-05
## 1166       BP             2.209211e-04
## 853        BP             4.832263e-04
## 900        BP             5.886216e-04
## 646        BP             5.886216e-04
## 1174       BP             1.131616e-03
## 423        BP             1.131616e-03
## 894        BP             1.494730e-03
## 557        BP             1.635737e-03
## 855        BP             3.206028e-03
## 898        BP             4.117764e-03
## 1038       BP             4.818943e-03
## 2859       BP             4.818943e-03
## 2439       BP             6.300748e-03
## 972        BP             6.629012e-03
## 3442       BP             7.674704e-03
## 1857       BP             9.274433e-03
## 1107       BP             9.792310e-03
## 3164       BP             1.095752e-02
## 1183       BP             1.363063e-02
## 2617       BP             1.761126e-02
## 1858       BP             1.761126e-02
## 2986       BP             2.109967e-02
## 3114       BP             2.244367e-02
## 2917       BP             2.252148e-02
## 607        BP             2.911133e-02
## 478        BP             3.535742e-02
## 49         BP             3.535742e-02
## 1002       BP             4.028820e-02
write_csv(GO.ORA.temp, path=file.path("..","output","twoafternoon.interaction.trtlive.samplingday.DEGs.GO.ORA.v3.0anno.csv"))

ORA: two afternoon trt + interaction only and expression pattern

twoafternoon.any.trtlive.DEGs.all.v3.0anno<-read_csv(file=file.path("..","output","twoafternoon.any.trtlive.DEGs.all.v3.0anno.csv"))
## Parsed with column specification:
## cols(
##   genes = col_character(),
##   logFC.sampling_day03 = col_double(),
##   logFC.sampling_day04 = col_double(),
##   logFC.sampling_day06 = col_double(),
##   logFC.sampling_day08 = col_double(),
##   logFC.sampling_day10 = col_double(),
##   logFC.sampling_day13 = col_double(),
##   logFC.sampling_day14 = col_double(),
##   logCPM = col_double(),
##   LR = col_double(),
##   PValue = col_double(),
##   FDR = col_double(),
##   AGI = col_character(),
##   At_symbol = col_character(),
##   At_short_description = col_character(),
##   perc_ID = col_double()
## )
    temp<-twoafternoon.any.trtlive.DEGs.all.v3.0anno
    genelist<-temp[temp[,"FDR"]<0.05,"genes"]
   print(paste("number of up genes is ",dim(genelist)[1]))
## [1] "number of up genes is  15376"
  # expression pattern 
   gene.of.interest.FDR <- twoafternoon.any.trtlive.DEGs.all.v3.0anno %>% filter(FDR< 0.05) %>%
     dplyr::select(genes,FDR) %>% arrange(FDR)
   p1<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[1,]);p1
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector
## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p2<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[2,]);p2
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p3<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[3,]);p3
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p4<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[4,]);p4
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   p5<-expression.pattern.Br.graph.timecourse.v3.0annotation.cpm(target.genes.FDR=gene.of.interest.FDR[5,]);p5
## Warning: Column `sample` joining character vector and factor, coercing into
## character vector

## Warning: Column `target_id`/`genes` joining factor and character vector,
## coercing into character vector

   if(dim(genelist)[1]<3) {print("Number of up genes is smaller than three. Skip this."); GO.ORA.temp<-"no enriched GO";next} else {
     GO.ORA.temp<-GOseq.Brgo.v3.0.Atgoslim.BP.list.ORA(as_vector(genelist)) 
   }
## Warning in pcls(G): initial point very close to some inequality constraints
## Using manually entered categories.
## Calculating the p-values...
## 'select()' returned 1:1 mapping between keys and columns

## [1] "enriched.GO is"
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 390  GO:0006412            2.513901e-76                1.0000000        417
## 921  GO:0009651            2.165836e-38                1.0000000        566
## 2575 GO:0046686            8.729195e-23                1.0000000        395
## 2211 GO:0042254            4.407992e-20                1.0000000        127
## 859  GO:0009414            5.762949e-20                1.0000000        315
## 854  GO:0009408            2.798669e-19                1.0000000        181
## 960  GO:0009737            5.874027e-16                1.0000000        402
## 646  GO:0006979            3.842850e-15                1.0000000        253
## 2917 GO:0055114            1.865078e-14                1.0000000        849
## 855  GO:0009409            1.975804e-14                1.0000000        330
## 359  GO:0006355            1.391844e-11                1.0000000       1189
## 2088 GO:0034605            1.504203e-11                1.0000000         77
## 958  GO:0009735            1.183400e-10                1.0000000        201
## 419  GO:0006457            1.333500e-10                1.0000000        205
## 178  GO:0002181            1.406214e-10                1.0000000         49
## 2253 GO:0042742            4.110520e-10                1.0000000        341
## 890  GO:0009611            4.640262e-10                1.0000000        210
## 3270 GO:0080167            5.448245e-10                1.0000000        134
## 642  GO:0006970            1.554491e-09                1.0000000        134
## 2239 GO:0042542            3.044208e-09                1.0000000         75
## 1210 GO:0010200            7.192915e-09                1.0000000        142
## 2152 GO:0035556            8.282079e-09                1.0000000        168
## 8    GO:0000027            1.949066e-08                1.0000000         44
## 894  GO:0009617            3.028600e-08                1.0000000        127
## 392  GO:0006414            3.900309e-08                1.0000000         62
## 1008 GO:0009826            1.137540e-07                1.0000000        134
## 2646 GO:0048364            1.237742e-07                1.0000000        167
## 1183 GO:0010150            2.248077e-07                1.0000000        114
## 3708 GO:2000022            3.049337e-07                0.9999999         54
## 972  GO:0009751            6.702788e-07                1.0000000        160
## 2254 GO:0042744            8.537941e-07                0.9999996         81
## 853  GO:0009407            8.721278e-07                0.9999998         38
## 914  GO:0009644            9.815138e-07                0.9999996         61
## 9    GO:0000028            1.339666e-06                0.9999996         34
## 2768 GO:0051085            1.696591e-06                0.9999994         50
## 1327 GO:0010411            2.116743e-06                0.9999993         48
## 557  GO:0006749            2.424669e-06                0.9999992         47
## 973  GO:0009753            4.575015e-06                0.9999977        157
## 967  GO:0009744            4.983374e-06                0.9999978         72
## 952  GO:0009723            5.460473e-06                0.9999974        122
## 1087 GO:0009970            6.394732e-06                0.9999994         19
## 739  GO:0007623            8.108282e-06                0.9999959         94
## 1530 GO:0016036            9.354672e-06                0.9999956         84
## 961  GO:0009738            1.043318e-05                0.9999937        198
## 3255 GO:0080147            1.231773e-05                0.9999971         28
## 2716 GO:0048767            1.294488e-05                0.9999948         57
## 3251 GO:0080142            1.488489e-05                0.9999989         17
## 153  GO:0001666            1.619553e-05                0.9999940         49
## 649  GO:0006986            1.875522e-05                0.9999967         24
## 423  GO:0006468            2.030599e-05                0.9999841        657
## 1737 GO:0019761            2.068416e-05                0.9999930         43
## 898  GO:0009625            2.208400e-05                0.9999916         47
## 2091 GO:0034620            2.507802e-05                0.9999943         27
## 2487 GO:0045893            2.555948e-05                0.9999826        241
## 2913 GO:0055085            2.825093e-05                0.9999807        270
## 594  GO:0006833            5.088514e-05                0.9999886         23
## 1205 GO:0010193            6.063073e-05                0.9999809         33
## 676  GO:0007043            6.756895e-05                0.9999957         10
## 1166 GO:0010112            7.427518e-05                0.9999891         17
## 3252 GO:0080143            7.827289e-05                0.9999941          9
## 3217 GO:0080037            7.909464e-05                0.9999966         11
## 1174 GO:0010120            8.907454e-05                0.9999834         20
## 2196 GO:0042026            9.201446e-05                0.9999600         52
## 607  GO:0006869            9.847090e-05                0.9999455         82
## 2795 GO:0051259            9.995934e-05                0.9999835         14
## 992  GO:0009800            1.061107e-04                1.0000000         10
## 985  GO:0009787            1.098167e-04                0.9999747         23
## 1760 GO:0030001            1.114888e-04                0.9999453         64
## 1001 GO:0009816            1.127544e-04                0.9999504         55
## 3546 GO:1902347            1.237733e-04                1.0000000         11
## 602  GO:0006855            1.255455e-04                0.9999378         74
## 1003 GO:0009819            1.275301e-04                0.9999780         18
## 2241 GO:0042546            1.357358e-04                0.9999403         51
## 452  GO:0006520            1.438881e-04                0.9999379         51
## 957  GO:0009734            1.515406e-04                0.9999001        161
## 87   GO:0000463            1.627838e-04                0.9999710         16
## 2679 GO:0048527            1.668161e-04                0.9999249         50
## 1116 GO:0010043            1.677154e-04                0.9999298         44
## 861  GO:0009416            1.680664e-04                0.9998877        174
## 91   GO:0000470            1.836594e-04                0.9999626         17
## 32   GO:0000162            2.034271e-04                0.9999482         24
## 3747 GO:2000306            2.434559e-04                0.9999891          9
## 2750 GO:0050832            2.519962e-04                0.9998246        192
## 636  GO:0006949            2.640376e-04                0.9999465         17
## 2259 GO:0042761            4.208985e-04                0.9998964         20
## 2973 GO:0061408            4.256525e-04                0.9998578         28
## 26   GO:0000103            4.366330e-04                0.9999112         17
## 1422 GO:0010942            4.650260e-04                0.9999430         13
## 1072 GO:0009955            4.807824e-04                0.9999569         11
## 748  GO:0008202            5.221926e-04                0.9998809         19
## 899  GO:0009626            5.278762e-04                0.9997147         72
## 2908 GO:0055073            5.495436e-04                1.0000000          5
## 897  GO:0009624            5.563898e-04                0.9996779         87
## 1030 GO:0009862            5.892519e-04                0.9998762         17
## 634  GO:0006914            6.115633e-04                0.9997652         32
## 2301 GO:0043069            6.195394e-04                0.9998401         19
## 203  GO:0003400            6.672923e-04                0.9999646          9
## 793  GO:0009098            6.841475e-04                0.9998234         20
## 2486 GO:0045892            6.884630e-04                0.9995310        152
## 1031 GO:0009863            7.091159e-04                0.9997831         24
## 2237 GO:0042538            7.202583e-04                0.9996160         60
## 910  GO:0009640            7.304979e-04                0.9996102         64
## 736  GO:0007568            7.436470e-04                0.9996590         42
## 930  GO:0009664            7.802128e-04                0.9996299         47
## 2889 GO:0052544            7.830832e-04                0.9997955         22
## 291  GO:0006207            8.882380e-04                0.9998429         14
## 1173 GO:0010119            9.290823e-04                0.9995077         62
## 2526 GO:0046274            9.944056e-04                0.9997488         21
## 860  GO:0009415            1.044018e-03                0.9998658          9
## 1671 GO:0019344            1.050348e-03                0.9996507         25
## 2964 GO:0061024            1.067505e-03                1.0000000          6
## 269  GO:0006120            1.131954e-03                0.9997453         13
## 1125 GO:0010053            1.146115e-03                0.9996112         26
## 2848 GO:0051603            1.211855e-03                0.9993065         72
## 516  GO:0006633            1.222438e-03                0.9992672         83
## 1380 GO:0010583            1.274437e-03                0.9994483         37
## 2831 GO:0051513            1.385094e-03                1.0000000          8
## 2214 GO:0042273            1.402079e-03                0.9995883         18
## 1916 GO:0032259            1.453590e-03                0.9990018        143
## 774  GO:0009058            1.490785e-03                0.9991314         77
## 1769 GO:0030042            1.557542e-03                0.9996215         14
##      numInCat
## 390       715
## 921      1045
## 2575      753
## 2211      236
## 859       596
## 854       305
## 960       832
## 646       502
## 2917     1923
## 855       696
## 359      2992
## 2088      117
## 958       412
## 419       423
## 178        83
## 2253      726
## 890       419
## 3270      254
## 642       252
## 2239      130
## 1210      286
## 2152      313
## 8          72
## 894       241
## 392       105
## 1008      256
## 2646      326
## 1183      219
## 3708       89
## 972       347
## 2254      146
## 853        67
## 914       109
## 9          61
## 2768       82
## 1327       77
## 557        85
## 973       338
## 967       136
## 952       255
## 1087       22
## 739       181
## 1530      148
## 961       437
## 3255       42
## 2716       99
## 3251       19
## 153        83
## 649        31
## 423      1484
## 1737       69
## 898        84
## 2091       38
## 2487      570
## 2913      562
## 594        34
## 1205       54
## 676        12
## 1166       22
## 3252       12
## 3217       12
## 1174       27
## 2196       97
## 607       208
## 2795       22
## 992        10
## 985        33
## 1760      130
## 1001       97
## 3546       11
## 602       130
## 1003       24
## 2241       95
## 452        90
## 957       377
## 87         23
## 2679       99
## 1116       83
## 861       394
## 91         26
## 32         35
## 3747       10
## 2750      469
## 636        25
## 2259       30
## 2973       47
## 26         24
## 1422       16
## 1072       13
## 748        27
## 899       140
## 2908        5
## 897       176
## 1030       24
## 634        58
## 2301       30
## 203        10
## 793        30
## 2486      355
## 1031       38
## 2237      132
## 910       129
## 736        85
## 930        91
## 2889       31
## 291        19
## 1173      121
## 2526       29
## 860        13
## 1671       41
## 2964        6
## 269        23
## 1125       42
## 2848      151
## 516       180
## 1380       67
## 2831        8
## 2214       32
## 1916      324
## 774       154
## 1769       24
##                                                                                                 term
## 390                                                                                      translation
## 921                                                                          response to salt stress
## 2575                                                                         response to cadmium ion
## 2211                                                                             ribosome biogenesis
## 859                                                                    response to water deprivation
## 854                                                                                 response to heat
## 960                                                                        response to abscisic acid
## 646                                                                     response to oxidative stress
## 2917                                                                     oxidation-reduction process
## 855                                                                                 response to cold
## 359                                                       regulation of transcription, DNA-templated
## 2088                                                                       cellular response to heat
## 958                                                                            response to cytokinin
## 419                                                                                  protein folding
## 178                                                                          cytoplasmic translation
## 2253                                                                   defense response to bacterium
## 890                                                                             response to wounding
## 3270                                                                            response to karrikin
## 642                                                                       response to osmotic stress
## 2239                                                                   response to hydrogen peroxide
## 1210                                                                              response to chitin
## 2152                                                               intracellular signal transduction
## 8                                                                   ribosomal large subunit assembly
## 894                                                                            response to bacterium
## 392                                                                         translational elongation
## 1008                                                                      unidimensional cell growth
## 2646                                                                                root development
## 1183                                                                                 leaf senescence
## 3708                                          regulation of jasmonic acid mediated signaling pathway
## 972                                                                       response to salicylic acid
## 2254                                                             hydrogen peroxide catabolic process
## 853                                                                          toxin catabolic process
## 914                                                                 response to high light intensity
## 9                                                                   ribosomal small subunit assembly
## 2768                                                  chaperone cofactor-dependent protein refolding
## 1327                                                                    xyloglucan metabolic process
## 557                                                                    glutathione metabolic process
## 973                                                                        response to jasmonic acid
## 967                                                                              response to sucrose
## 952                                                                             response to ethylene
## 1087                                                         cellular response to sulfate starvation
## 739                                                                                 circadian rhythm
## 1530                                                       cellular response to phosphate starvation
## 961                                                        abscisic acid-activated signaling pathway
## 3255                                                                      root hair cell development
## 2716                                                                            root hair elongation
## 3251                                               regulation of salicylic acid biosynthetic process
## 153                                                                              response to hypoxia
## 649                                                                     response to unfolded protein
## 423                                                                          protein phosphorylation
## 1737                                                              glucosinolate biosynthetic process
## 898                                                                               response to insect
## 2091                                                           cellular response to unfolded protein
## 2487                                             positive regulation of transcription, DNA-templated
## 2913                                                                         transmembrane transport
## 594                                                                                  water transport
## 1205                                                                               response to ozone
## 676                                                                      cell-cell junction assembly
## 1166                                                      regulation of systemic acquired resistance
## 3252                                                                 regulation of amino acid export
## 3217                                    negative regulation of cytokinin-activated signaling pathway
## 1174                                                                  camalexin biosynthetic process
## 2196                                                                               protein refolding
## 607                                                                                  lipid transport
## 2795                                                                 protein complex oligomerization
## 992                                                               cinnamic acid biosynthetic process
## 985                                          regulation of abscisic acid-activated signaling pathway
## 1760                                                                             metal ion transport
## 1001                                         defense response to bacterium, incompatible interaction
## 3546                                                                       response to strigolactone
## 602                                                                     drug transmembrane transport
## 1003                                                                                drought recovery
## 2241                                                                            cell wall biogenesis
## 452                                                            cellular amino acid metabolic process
## 957                                                                auxin-activated signaling pathway
## 87          maturation of LSU-rRNA from tricistronic rRNA transcript (SSU-rRNA, 5.8S rRNA, LSU-rRNA)
## 2679                                                                        lateral root development
## 1116                                                                            response to zinc ion
## 861                                                                       response to light stimulus
## 91                                                                            maturation of LSU-rRNA
## 32                                                                   tryptophan biosynthetic process
## 3747                                                       positive regulation of photomorphogenesis
## 2750                                                                      defense response to fungus
## 636                                                                              syncytium formation
## 2259                                                 very long-chain fatty acid biosynthetic process
## 2973 positive regulation of transcription from RNA polymerase II promoter in response to heat stress
## 26                                                                              sulfate assimilation
## 1422                                                               positive regulation of cell death
## 1072                                                           adaxial/abaxial pattern specification
## 748                                                                        steroid metabolic process
## 899                                                               plant-type hypersensitive response
## 2908                                                                         cadmium ion homeostasis
## 897                                                                             response to nematode
## 1030                         systemic acquired resistance, salicylic acid mediated signaling pathway
## 634                                                                                        autophagy
## 2301                                                    negative regulation of programmed cell death
## 203                                                              regulation of COPII vesicle coating
## 793                                                                     leucine biosynthetic process
## 2486                                             negative regulation of transcription, DNA-templated
## 1031                                                       salicylic acid mediated signaling pathway
## 2237                                                                  hyperosmotic salinity response
## 910                                                                               photomorphogenesis
## 736                                                                                            aging
## 930                                                                plant-type cell wall organization
## 2889                                             defense response by callose deposition in cell wall
## 291                                             'de novo' pyrimidine nucleobase biosynthetic process
## 1173                                                                 regulation of stomatal movement
## 2526                                                                        lignin catabolic process
## 860                                                                                response to water
## 1671                                                                   cysteine biosynthetic process
## 2964                                                                           membrane organization
## 269                                             mitochondrial electron transport, NADH to ubiquinone
## 1125                                                             root epidermal cell differentiation
## 2848                                      proteolysis involved in cellular protein catabolic process
## 516                                                                  fatty acid biosynthetic process
## 1380                                                                      response to cyclopentenone
## 2831                                                             regulation of monopolar cell growth
## 2214                                                              ribosomal large subunit biogenesis
## 1916                                                                                     methylation
## 774                                                                             biosynthetic process
## 1769                                                                 actin filament depolymerization
##      ontology over_represented_padjust
## 390        BP             9.525171e-73
## 921        BP             4.103175e-35
## 2575       BP             1.102497e-19
## 2211       BP             4.175470e-17
## 859        BP             4.367163e-17
## 854        BP             1.767360e-16
## 960        BP             3.179527e-13
## 646        BP             1.820070e-12
## 2917       BP             7.486321e-12
## 855        BP             7.486321e-12
## 359        BP             4.749521e-09
## 2088       BP             4.749521e-09
## 958        BP             3.449155e-08
## 419        BP             3.552098e-08
## 178        BP             3.552098e-08
## 2253       BP             9.734226e-08
## 890        BP             1.034233e-07
## 3270       BP             1.146856e-07
## 642        BP             3.099983e-07
## 2239       BP             5.767253e-07
## 1210       BP             1.297807e-06
## 2152       BP             1.426400e-06
## 8          BP             3.210875e-06
## 894        BP             4.781402e-06
## 392        BP             5.911309e-06
## 1008       BP             1.657745e-05
## 2646       BP             1.736964e-05
## 1183       BP             3.042130e-05
## 3708       BP             3.984116e-05
## 972        BP             8.465621e-05
## 2254       BP             1.032654e-04
## 853        BP             1.032654e-04
## 914        BP             1.126956e-04
## 9          BP             1.492940e-04
## 2768       BP             1.836681e-04
## 1327       BP             2.227872e-04
## 557        BP             2.482992e-04
## 973        BP             4.561771e-04
## 967        BP             4.841539e-04
## 952        BP             5.172433e-04
## 1087       BP             5.909668e-04
## 739        BP             7.314829e-04
## 1530       BP             8.242989e-04
## 961        BP             8.984394e-04
## 3255       BP             1.037153e-03
## 2716       BP             1.066264e-03
## 3251       BP             1.199975e-03
## 153        BP             1.278435e-03
## 649        BP             1.450276e-03
## 423        BP             1.536711e-03
## 1737       BP             1.536711e-03
## 898        BP             1.609159e-03
## 2091       BP             1.792842e-03
## 2487       BP             1.793424e-03
## 2913       BP             1.946232e-03
## 594        BP             3.442925e-03
## 1205       BP             4.030348e-03
## 676        BP             4.414116e-03
## 1166       BP             4.769977e-03
## 3252       BP             4.912944e-03
## 3217       BP             4.912944e-03
## 1174       BP             5.443604e-03
## 2196       BP             5.534013e-03
## 607        BP             5.826860e-03
## 2795       BP             5.826860e-03
## 992        BP             6.091719e-03
## 985        BP             6.191689e-03
## 1760       BP             6.191689e-03
## 1001       BP             6.191689e-03
## 3546       BP             6.699672e-03
## 602        BP             6.699888e-03
## 1003       BP             6.711271e-03
## 2241       BP             7.045247e-03
## 452        BP             7.367459e-03
## 957        BP             7.655830e-03
## 87         BP             8.060805e-03
## 2679       BP             8.060805e-03
## 1116       BP             8.060805e-03
## 861        BP             8.060805e-03
## 91         BP             8.698568e-03
## 32         BP             9.515868e-03
## 3747       BP             1.124944e-02
## 2750       BP             1.150378e-02
## 636        BP             1.190998e-02
## 2259       BP             1.875346e-02
## 2973       BP             1.875346e-02
## 26         BP             1.901612e-02
## 1422       BP             2.002254e-02
## 1072       BP             2.046836e-02
## 748        BP             2.197937e-02
## 899        BP             2.197937e-02
## 2908       BP             2.263284e-02
## 897        BP             2.266840e-02
## 1030       BP             2.375186e-02
## 634        BP             2.439172e-02
## 2301       BP             2.445245e-02
## 203        BP             2.606568e-02
## 793        BP             2.634936e-02
## 2486       BP             2.634936e-02
## 1031       BP             2.686840e-02
## 2237       BP             2.702038e-02
## 910        BP             2.713585e-02
## 736        BP             2.735610e-02
## 930        BP             2.825812e-02
## 2889       BP             2.825812e-02
## 291        BP             3.175032e-02
## 1173       BP             3.289993e-02
## 2526       BP             3.488706e-02
## 860        BP             3.617970e-02
## 1671       BP             3.617970e-02
## 2964       BP             3.643942e-02
## 269        BP             3.829442e-02
## 1125       BP             3.843036e-02
## 2848       BP             4.027667e-02
## 516        BP             4.027667e-02
## 1380       BP             4.162793e-02
## 2831       BP             4.485574e-02
## 2214       BP             4.502099e-02
## 1916       BP             4.628279e-02
## 774        BP             4.707152e-02
## 1769       BP             4.877295e-02
write_csv(GO.ORA.temp, path=file.path("..","output","twoafternoon.any.trtlive.DEGs.DEGs.GO.ORA.v3.0anno.csv"))

session info

sessionInfo
## function (package = NULL) 
## {
##     z <- list()
##     z$R.version <- R.Version()
##     z$platform <- z$R.version$platform
##     if (nzchar(.Platform$r_arch)) 
##         z$platform <- paste(z$platform, .Platform$r_arch, sep = "/")
##     z$platform <- paste0(z$platform, " (", 8 * .Machine$sizeof.pointer, 
##         "-bit)")
##     z$locale <- Sys.getlocale()
##     z$running <- osVersion
##     z$RNGkind <- RNGkind()
##     if (is.null(package)) {
##         package <- grep("^package:", search(), value = TRUE)
##         keep <- vapply(package, function(x) x == "package:base" || 
##             !is.null(attr(as.environment(x), "path")), NA)
##         package <- .rmpkg(package[keep])
##     }
##     pkgDesc <- lapply(package, packageDescription, encoding = NA)
##     if (length(package) == 0) 
##         stop("no valid packages were specified")
##     basePkgs <- sapply(pkgDesc, function(x) !is.null(x$Priority) && 
##         x$Priority == "base")
##     z$basePkgs <- package[basePkgs]
##     if (any(!basePkgs)) {
##         z$otherPkgs <- pkgDesc[!basePkgs]
##         names(z$otherPkgs) <- package[!basePkgs]
##     }
##     loadedOnly <- loadedNamespaces()
##     loadedOnly <- loadedOnly[!(loadedOnly %in% package)]
##     if (length(loadedOnly)) {
##         names(loadedOnly) <- loadedOnly
##         pkgDesc <- c(pkgDesc, lapply(loadedOnly, packageDescription))
##         z$loadedOnly <- pkgDesc[loadedOnly]
##     }
##     z$matprod <- as.character(options("matprod"))
##     es <- extSoftVersion()
##     z$BLAS <- as.character(es["BLAS"])
##     z$LAPACK <- La_library()
##     class(z) <- "sessionInfo"
##     z
## }
## <bytecode: 0x7fab9925cd98>
## <environment: namespace:utils>